package com.mapbased.wfw.handler;

import com.mapbased.wfw.*;
import java.util.Map;
import java.io.StringWriter;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: mapbased.com</p>
 *
 * @author chy_hs(Baily)
 * @version 1.0
 */
public class ErrorHandler
    extends PageHandler
{

    public String throwableBinding(Map m)
    {
        Throwable t=(Throwable)m.get(com.mapbased.wfw.Constants.
                                     Error_Page_Throwable);
        StringWriter sw=new java.io.StringWriter();

        if(t != null)
        {
            try
            {
                t.printStackTrace(new java.io.PrintWriter(sw));
            }
            catch(Exception ex)
            {
                ex.printStackTrace();
            }
        }
        return sw.toString();
    }

}
